# 记录学生成绩
def record_grade(student, course, grade):
    with open('grades.txt', 'a') as f:
        f.write(f"{student},{course},{grade}\n")

# 查询学生成绩
def query_grade(student):
    results = []
    with open('grades.txt', 'r') as f:
        for line in f:
            s, c, g = line.strip().split(',')
            if s == student:
                results.append((c, g))
    return results